home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / Libraries / DLOGManager 1.02 / DLOG Manager User Manual / DLOG Manager User Manual.rsrc / TEXT_129.txt < prev    next >
Encoding:
Text File  |  1996-10-16  |  1.4 KB  |  244 lines

  1.  
  2. Example
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25. We want to create for handle a the window in figure.
  26.  
  27. First we must create this resources:
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93. And the DLOG descriptor 'EdF'
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175. Now we must write the code to handle this data.
  176.  
  177. /***
  178.  *        run();
  179.  *
  180.  *        Handle the Dialog of the example. 
  181.  *        (exampleDialog = 132, exampleDLOGDescr = 132)
  182.  *
  183.  ***/
  184. void Example::run(void)
  185. {
  186.         DialogPtr                                                exampleDialog;
  187.         CgestisciDLOGDati    exampleDLOG;
  188.         EventRecord                                        event;
  189.         short                                                                itemHit, pos;
  190.         Boolean                                                        status;
  191.  
  192.         exampleDialog = GetNewDialog(exampleDLOGID, NULL, (WindowPtr)-1L);
  193.         if (exampleDialog != NULL &&     
  194.                         !exampleDLOG.IgestisciDLOGDati(exampleDialog, exampleDLOGDescr))
  195.         {
  196.                 exampleDLOG.disableAboutDLOG = true;
  197.              do
  198.              {                    
  199.                         exampleDLOG.idle();
  200.                      GetNextEvent(everyEvent, &event);
  201.                      itemHit = exampleDLOG.gestEvent(&event);
  202.                      if (itemHit == -1 && IsDialogEvent(&event))
  203.                      {
  204.                              DialogSelect(&event, &helpDialog, &itemHit);
  205.                              exampleDLOG.itemSelect(&event, itemHit, &pos, &status);
  206.                      }
  207.                      if (itemHit == okexampleDLOGitem)
  208.                                 break;
  209.                      }
  210.                      while(true);
  211.                      exampleDLOG.Dispose();
  212.                      DisposDialog(exampleDialog);
  213.             }
  214.             else if (exampleDialog != NULL)
  215.                      DisposDialog(exampleDialog);
  216. }
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.